﻿using System;
using System.Windows;
using System.Windows.Media;

namespace LpbPrj.Client.Controls;

/// <summary>
/// VideoListAttach
/// </summary>
public class VideoListAttach
{
    /// <summary>
    /// 选中背景色
    /// </summary>
    public static readonly DependencyProperty SelectedBackgroundProperty = DependencyProperty.RegisterAttached(
        "SelectedBackground", typeof(Brush), typeof(VideoListAttach), new FrameworkPropertyMetadata(Brushes.Red, FrameworkPropertyMetadataOptions.Inherits));
    public static void SetSelectedBackground(DependencyObject element, Brush value) => element.SetValue(SelectedBackgroundProperty, value);
    public static Brush GetSelectedBackground(DependencyObject element) => (Brush)element.GetValue(SelectedBackgroundProperty);

    /// <summary>
    /// 选中前景色
    /// </summary>
    public static readonly DependencyProperty SelectedForegroundProperty = DependencyProperty.RegisterAttached(
        "SelectedForeground", typeof(Brush), typeof(VideoListAttach), new FrameworkPropertyMetadata(Brushes.Red, FrameworkPropertyMetadataOptions.Inherits));
    public static void SetSelectedForeground(DependencyObject element, Brush value) => element.SetValue(SelectedForegroundProperty, value);
    public static Brush GetSelectedForeground(DependencyObject element) => (Brush)element.GetValue(SelectedForegroundProperty);

    /// <summary>
    /// 行间距
    /// </summary>
    public static readonly DependencyProperty ItemMarginProperty = DependencyProperty.RegisterAttached(
        "ItemMargin", typeof(Thickness), typeof(VideoListAttach), new FrameworkPropertyMetadata(new Thickness(0, 0, 5, 0), FrameworkPropertyMetadataOptions.Inherits));
    public static void SetItemMargin(DependencyObject element, Thickness value) => element.SetValue(ItemMarginProperty, value);
    public static Thickness GetItemMargin(DependencyObject element) => (Thickness)element.GetValue(ItemMarginProperty);
    /// <summary>
    /// 行高
    /// </summary>
    public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.RegisterAttached(
        "ItemHeight", typeof(double), typeof(VideoListAttach), new FrameworkPropertyMetadata(20.0, FrameworkPropertyMetadataOptions.Inherits));
    public static void SetItemHeight(DependencyObject element, double value) => element.SetValue(ItemHeightProperty, value);
    public static double GetItemHeight(DependencyObject element) => (double)element.GetValue(ItemHeightProperty);
    /// <summary>
    /// 行背景色
    /// </summary>
    public static readonly DependencyProperty ItemBackgroundProperty = DependencyProperty.RegisterAttached(
        "ItemBackground", typeof(Brush), typeof(VideoListAttach), new FrameworkPropertyMetadata(Brushes.Red, FrameworkPropertyMetadataOptions.Inherits));
    public static void SetItemBackground(DependencyObject element, Brush value) => element.SetValue(ItemBackgroundProperty, value);
    public static Brush GetItemBackground(DependencyObject element) => (Brush)element.GetValue(ItemBackgroundProperty);
    /// <summary>
    /// 行前景色
    /// </summary>
    public static readonly DependencyProperty ItemForegroundProperty = DependencyProperty.RegisterAttached(
        "ItemForeground", typeof(Brush), typeof(VideoListAttach), new FrameworkPropertyMetadata(Brushes.Red, FrameworkPropertyMetadataOptions.Inherits));
    public static void SetItemForeground(DependencyObject element, Brush value) => element.SetValue(ItemForegroundProperty, value);
    public static Brush GetItemForeground(DependencyObject element) => (Brush)element.GetValue(ItemForegroundProperty);

}